<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
      <head>
      <title></title>
      </head>
      <body>
        <div id="debug">LoadPercentage:</div>
      wmi参考：http://msdn.microsoft.com/en-us/library/aa394373(VS.85).aspx
      <script language=javascript>
      var locator = new ActiveXObject ("WbemScripting.SWbemLocator");
      function getCpuLoadPercentage()
      {
            var service = locator.ConnectServer(".");
            var properties = service.ExecQuery("SELECT * FROM Win32_Processor");
            var e = new Enumerator (properties);
            for (;!e.atEnd();e.moveNext ())
            {
                  var p = e.item ();
                  document.getElementById("debug").innerHTML += p.LoadPercentage + " ";
            }
      }
      setInterval(function(){getCpuLoadPercentage();},100);
      </script>
      </body>
</html>
 